package fun.coding.jeffreys.judge;

import java.util.List;

public class NestedListImpl implements NestedList {
	private Integer integerMember = null;
	private List<NestedList> listMember = null;
	
	public NestedListImpl(Object o) {
		if (o instanceof Integer) {
			this.integerMember = (Integer)o;
		} else if (o instanceof List) {
			this.listMember = (List<NestedList>)o;
		} else {
			System.err.println("Not supported type!!");
		}
	}
	
	@Override
	public boolean isInt() {
		return this.integerMember != null ? true : false;
	}

	@Override
	public Integer getInt() {
		return this.integerMember;
	}

	@Override
	public List<NestedList> getList() {
		return this.listMember;
	}

}
